import prompt from '@system.prompt'
import router from '@system.router';
export default {
    data: {
//        birthday: "点击选择生日",
//        birthdayVal: "",

        phone: '',
        date: '1990-01-01',
        gender: '男',
        area: '亚洲',
    },

    getPhone(e) {
        this.phone = e.value;
        console.info("phone=" + this.phone)
    },
    getDate(e) {
        this.date = e.year + '-' + (e.month + 1) + '-' + e.day;
        console.info("date=" + this.date)
    },
    getFemaleGender(e) {
        if (e.checked) {
            this.gender = 'Strings.female'
            console.info("gender =" + this.gender)
        }
    },
    getMaleGender(e) {
        if (e.checked) {
            this.gender = 'Strings.male'
            console.info("gender =" + this.gender)
        }
    },
    getArea(e) {
        this.education = e.newValue;
        console.info("education=" + this.education)
    },
    onRegiste() {
        if (this.name.length == 0) {
            prompt.showToast({
                message: this.$t('Strings.name_null')
            })
            return;
        }
        if (this.name.length < 6) {
            prompt.showToast({
                message: this.$t('Strings.name_short')
            })
            return;
        }
        if (this.date.length == 0) {
            prompt.showToast({
                message: this.$t('Strings.date_null')
            })
            return;
        }

        if (this.gender.length == 0) {
            prompt.showToast({
                message: this.$t('Strings.gender_null')
            })
            return;
        }

        if (this.education.length == 0) {
            prompt.showToast({
                message: this.$t('Strings.education_null')
            })
            return;
        }

        prompt.showToast({
            message: "注册成功",
            duration: 3000,
        });

        router.push({
            uri: 'pages/login/login'
        })
    },

    last() {
        router.push ({
            uri:'pages/login/login', // 指定要跳转的页面
        })
    },
//    enterkeyClick(e){
//        prompt.showToast({
//            message: "确认注册",
//            duration: 3000,
//        });
//    },
//

//
//    registerFinish() {
//        prompt.showToast({
//            message: "注册成功",
//            duration: 3000,
//        });
//        router.push ({
//            uri:'pages/login/login', // 指定要跳转的页面
//        })
//    },
//
//    // 生日选择器
//    chooseBirthday(e) {
//        let month = (e.month + 1) + "";
//        if (month.length == 1) {
//            month = "0" + month;
//        }
//        let day = e.day + "";
//        if (day.length == 1) {
//            day = "0" + day;
//        }
//        let birthday = e.year + "-" + month + "-" + day;
//        this.birthday = birthday;
//        this.birthdayVal = birthday;
//    },

}
